import request from '../utils/request'

const api_name = `http://localhost:9001/admin/hospinfo`

export default {
    //获取检测点信息
    getHospInfoList(page,limit,searchObj){
        return request({
            method:"get",
            url:`${api_name}/getHospInfoList/${page}/${limit}`,
            params:searchObj
        })
    },

    //更改检测点状态
    changeStatus(id,status){
        return request({
            method:"put",
            url:`${api_name}/changeStatus/${id}/${status}`
        })
    },

    //根据id删除检测点
    deleteOne(id){
        return request({
            method:"delete",
            url:`${api_name}/deleteOne/${id}`
        })
    },

    //批量删除检测点
    batchDelete(ids) {
        return request({
            method:"delete",
            url:`${api_name}/batchDelete`,
            data:ids
        })
    },

    //根据id查询检测点信息
    getHospInfoById(id){
        return request({
            method:"get",
            url:`${api_name}/getHospInfoById/${id}`
        })
    },

    //解析时间字符串
    parseTimeStr(time){
        return request({
            method:"get",
            url:`${api_name}/parseTimeStr/${time}`
        })
    },

    //保存检测点的修改
    saveEdit(hospInfo){
        return request({
            method:"put",
            url:`${api_name}/saveEdit`,
            data:hospInfo
        })
    },

    //上传图标文件
    imgUpload(file){
        return request({
            method:'post',
            url:`${api_name}/imgUpload`,
            data:file
        })
    },

    //添加检测点信息
    addHospInfo(hospInfo) {
        return request({
            method:"post",
            url:`${api_name}/addHospInfo`,
            data:hospInfo
        })
    },

    //根据district查询检测点
    getHospInfoListByDistrict(district){
        return request({
            method:'get',
            url:`${api_name}/getHospInfoListByDistrict/${district}`
        })
    },

    //根据id查询医院名称
    getNameById(id){
        return request({
            method:'get',
            url:`${api_name}/getNameById/${id}`
        })
    },

    //查询所有检测点
    findAll(){
        return request({
            method:'get',
            url:`${api_name}/findAll`
        })
    }
}